# encoding: utf-8
# @File  : page_login.py
# @Author: wu shaofan
# @Date  :  2024/06/18
# @Desc :
from selenium.webdriver.common.by import By
from PO.base.base import Base
from utils.set_config import SetConfig


class PageLogin(Base):
    parm= SetConfig().get_config("caps", 'apppackage')

    # 我的按钮
    mine_btn = By.ID, 'com.bjcsxq.chat.carfriend:id/tv_home_mine'
    # 登录按钮
    login_btn = By.ID, f'{parm}:id/mine_username_tv'
    # 输入用户名
    username_loc = By.ID, 'com.bjcsxq.chat.carfriend:id/login_phone_et'
    # 输入密码
    password_loc = By.ID, 'com.bjcsxq.chat.carfriend:id/login_pwd_et'
    # 点击登录按钮
    login_btn_02 = By.ID, 'com.bjcsxq.chat.carfriend:id/login_btn'
    # 点击确定按钮
    ok_btn = By.ID, 'com.bjcsxq.chat.carfriend:id/btn_neg'


    # 点击我的按钮
    def page_click_mine_btn(self):
        self.base_click(self.mine_btn)

    # 点击登录按钮
    def page_click_login_btn(self):
        self.base_click(self.login_btn)

    # 输入用户名
    def page_input_username(self, username):
        self.base_input(self.username_loc, username)

    # 输入密码
    def page_input_password(self, password):
        self.base_input(self.password_loc, password)


    # 点击登录按钮
    def page_click_login_btn_02(self):
        self.base_click(self.login_btn_02)

    # 点击确定按钮
    def page_click_ok_btn(self):
        self.base_click(self.ok_btn)